package xyz.xuminghai.javafx_learn.scene.control;

import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Spinner;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;

/**
 * 2023/5/20 2:41 星期六<br/>
 * 微调器控件
 *
 * @author xuMingHai
 */
public class SpinnerApp extends Application {

    private final HBox hBox = new HBox();

    public static void main(String[] args) {
        Application.launch(args);
    }

    @Override
    public void init() {
        Spinner<Integer> spinner = new Spinner<>(0, 10, 0);
        spinner.setPrefWidth(55.0);


        hBox.setAlignment(Pos.CENTER);
        hBox.getChildren().add(spinner);
    }

    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle(getClass().getSimpleName());
        Scene scene = new Scene(hBox, 800, 600);
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}
